package com.wwj.airline.Service.impl;

import com.wwj.airline.Dao.UserMapper;
import com.wwj.airline.Service.UserService;
import com.wwj.airline.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;

    @Override
    public User getUser(Integer id) {
        User user = userMapper.findById(id);
        return user;
    }



    @Override
    public List<User> login(String email) {
        return  userMapper.findByEmail(email);
    }


    @Override
    public void insertUser(User user) {
        userMapper.insert(user);
    }

    @Override
    public void updateUser(User user) {
        userMapper.update(user);
    }
}
